<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">LDA</b>
<td valign="baseline" align="right" class="function"><a href="../../linear/extraction/index.html" target="mdsdir"><img border = 0 src="../../up.gif"></a></table>
  <p><b>Linear Discriminant Analysis.</b></p>
  <hr>
<div class='code'><code>
<span class=help>&nbsp;</span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;lda(data)</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;lda(data,new_dim)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;This&nbsp;function&nbsp;is&nbsp;implementation&nbsp;of&nbsp;Linear&nbsp;Discriminant&nbsp;Analysis.</span><br>
<span class=help>&nbsp;&nbsp;The&nbsp;goal&nbsp;is&nbsp;to&nbsp;train&nbsp;the&nbsp;linear&nbsp;transform&nbsp;which&nbsp;maximizes&nbsp;ratio&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;between&nbsp;between-class&nbsp;and&nbsp;within-class&nbsp;scatter&nbsp;matrix&nbsp;of&nbsp;projected&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;data.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;data&nbsp;[struct]&nbsp;Input&nbsp;labeled&nbsp;data:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Data&nbsp;sample.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.y&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;Labels&nbsp;(1,2,...,nclass).</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;new_dim&nbsp;[1x1]&nbsp;Output&nbsp;data&nbsp;dimension&nbsp;(default&nbsp;new_dim&nbsp;=&nbsp;dim).</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Ouput:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;[struct]&nbsp;Linear&nbsp;projection:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.W&nbsp;[dim&nbsp;x&nbsp;new_dim]&nbsp;Projection&nbsp;matrix.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.b&nbsp;[new_dim&nbsp;x&nbsp;1]&nbsp;Biases.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.mean_X&nbsp;[dim&nbsp;x&nbsp;1]&nbsp;Mean&nbsp;value&nbsp;of&nbsp;data.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.Sw&nbsp;[dim&nbsp;x&nbsp;dim]&nbsp;Within-class&nbsp;scatter&nbsp;matrix.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.Sb&nbsp;[dim&nbsp;x&nbsp;dim]&nbsp;Between-class&nbsp;scatter&nbsp;matrix.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.eigval&nbsp;[dim&nbsp;x&nbsp;1]&nbsp;Eigenvalues.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;in_data&nbsp;=&nbsp;load('iris');</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;lda(&nbsp;in_data,&nbsp;2&nbsp;);</span><br>
<span class=help>&nbsp;&nbsp;out_data&nbsp;=&nbsp;linproj(&nbsp;in_data,&nbsp;model);</span><br>
<span class=help>&nbsp;&nbsp;figure;&nbsp;ppatterns(out_data);</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=also_field>See also </span><span class=also></span><br>
<span class=help><span class=also>&nbsp;&nbsp;<a href = "../../linear/linproj.html" target="mdsbody">LINPROJ</a>,&nbsp;<a href = "../../linear/extraction/pca.html" target="mdsbody">PCA</a>.</span><br>
<span class=help></span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../../linear/extraction/list/lda.html">lda.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac<br>
 <a href="http://www.cvut.cz">Czech Technical University Prague</a><br>
 <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a><br>
 <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a><br>

  <p><b class="info_field">Modifications: </b> <br>
 05-oct-2006, VF<br>
 25-may-2004, VF<br>
 3-may-2004, VF<br>
 20-may-2001, V.Franc, created<br>

</body>
</html>
